# -*- coding: utf-8 -*-
# @Time : 2021/2/9 20:53
# @Author : YANWEI
# @File : t1
# @Project : Python
fi = open("论语.txt", 'r')
fo = open("论语-原文.txt", 'w')

a = 0
for line in fi:
    print(line)
    if a == 1 and line.count("【注释】") == 0 and line.count("【原文】") == 0:
        line = line.strip(" \n")
        # print(line)
        if line.strip():  # 判断line是否为空串
            fo.write('{}\n'.format(line))
    if line.count("【原文】") > 0:
        a = 1
    if line.count("【注释】") > 0:
        a = 0
